using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Furion;
using Mapster;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

namespace LNSServer
{
    public class Program
    {
        public static void Main(string[] args)
        {
            //Task.Run(() =>
            //{
            //    Process process = new();
            //    string workdir = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "lal_v0.29.1_windows");
            //    process.StartInfo.FileName = Path.Combine(workdir, "bin", "lalserver.exe");
            //    process.StartInfo.WorkingDirectory = workdir;
            //    process.StartInfo.UseShellExecute = true;
            //    process.StartInfo.CreateNoWindow = false;
            //    process.Start();
            //});
            TypeAdapterConfig.GlobalSettings.EnableJsonMapping();
            CreateHostBuilder(args).Build().Run();
        }

        public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                .ConfigureWebHostDefaults(webBuilder =>
                {
                    webBuilder.Inject().UseStartup<Startup>();
                });
    }
}
